/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fhv.itb.mst2955.client.model;

import java.io.Serializable;

/**
 * An object which is sent to the server for synchronization purposes.
 */
public class ChangeObject implements Serializable {
    private static final long serialVersionUID = 1L;
    public static final String NEW = "NEW";
    public static final String MODIFIED = "MOD";
    public static final String DELETED = "DEL";

    public static final String TYPE_ADDRESS = "AddressProxy";
    public static final String TYPE_CONTACT = "ContactProxy";
    public static final String TYPE_COUNTRY = "CountryProxy";

    /**
     * The objects class (ContactProxy, AddressProxy, ...).
     */
    private String objectType;

    /**
     * The type of change to this object.
     * Can be one of: NEW (object was newly created), DEL (the object was deleted on the client side),
     * MOD (the object was modified on the client side).
     */
    private String changeType;

    /**
     * The local (client-side) ID of the object in its database table.
     */
    private Integer objectId;

    /**
     * The actual object.
     * This may be null if the object was deleted.
     */
    private UpdateObject updateObject;


    public ChangeObject() {
    }


    public String getChangeType() {
        return changeType;
    }


    public void setChangeType(String changeType) {
        this.changeType = changeType;
    }


    public Integer getObjectId() {
        return objectId;
    }


    public void setObjectId(Integer objectId) {
        this.objectId = objectId;
    }


    public String getObjectType() {
        return objectType;
    }


    public void setObjectType(String objectType) {
        this.objectType = objectType;
    }


    public UpdateObject getUpdateObject() {
        return updateObject;
    }


    public void setUpdateObject(UpdateObject updateObject) {
        this.updateObject = updateObject;
    }

}
